package face.pay.web.company.controller;

import face.pay.entity.CompanyInfo;
import face.pay.entity.UserInfo;
import face.pay.security.annotation.CurrentUser;
import face.pay.security.exception.BaseException;
import face.pay.util.ResultMessage;
import face.pay.util.page.PageData;
import face.pay.util.page.PageParam;
import face.pay.web.company.service.ICompanyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Classname CompanyInfoController
 * @Description JJL
 * @Date 2019/11/5 13:46
 */
@Controller
@RequestMapping("/company")
public class CompanyInfoController {

    @Autowired
    private ICompanyInfoService companyInfoService;


    @RequestMapping("/companyList")
    public String manager(){

        return  "company/companyList";
    }

    @RequestMapping("/queryData")
    @ResponseBody
    public PageData data(String name, PageParam pageParam) throws BaseException {

        return  this.companyInfoService.queryPage(name,pageParam);

    }

    @RequestMapping("/editCompany")
    @ResponseBody
    public ResultMessage editCompany(CompanyInfo companyInfo) throws BaseException {

        return  this.companyInfoService.editCompany(companyInfo);

    }


}
